home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 July / EnigmA AMIGA RUN 20 (1997)(G.R. Edizioni)(IT)[!][issue 1997-07 & 08][EAR-CD IV].iso / earcd / comm / ums / pint.lha / UMS / Rexx / Filer.pint < prev    next >
Text File  |  1997-03-04  |  1KB  |  74 lines

  1. /*
  2.  
  3.     $VER: Filer.pint 1.0 (27.8.95)
  4.  
  5.    Author:
  6.     Matthias Scheler <tron@lyssa.owl.de>
  7.  
  8.    Updated for PINT (22.2.97):
  9.     Magnus Heino (nd95mho@Student.HGS.SE)
  10.  
  11.    Function:
  12.     Handles the file attached to a message with Filer.
  13.  
  14.    History:
  15.     0.1   initial version
  16.     0.2   uses new "EXEC" command
  17.     1.0   released with IntuiNews 1.3
  18.     1.1   fixed problem with filenames with spaces
  19.  
  20.    Requires:
  21.     UMSServer 11.28 or newer
  22.     ums.library 11.18 or newer
  23.     Filer 3.20 or newer
  24.  
  25.    Example for "ums.config":
  26.     ( PINT.Rexx
  27.     ...
  28.         "#?Message F2 Filer.pint\n"
  29.     ...
  30.     )
  31.  
  32. */
  33.  
  34. /* Get TEMPORARY filename. */
  35.  
  36. OPTIONS RESULTS
  37.  
  38. GETTEMPFILENAME
  39. IF RESULT="RESULT" THEN EXIT 5
  40. TempFileName=RESULT
  41.  
  42. /* Check wether Filer is running. */
  43.  
  44. IF ~SHOW('Ports','FilerRexx') THEN
  45.  DO
  46.   'EXEC Run >NIL: Filer >NIL:'
  47.   'EXEC SYS:Rexxc/WaitForPort FilerRexx'
  48.  
  49.   IF ~SHOW('Ports','FilerRexx') THEN EXIT 10
  50.  END
  51.  
  52. /* Load directory and select file. */
  53.  
  54. P=LASTPOS("/",FileName)
  55. IF P=0 THEN
  56.  DO
  57.   P=POS(":",TempFileName)
  58.   Dirname=LEFT(TempFileName,P)
  59.   Filename=SUBSTR(TempFileName,P+1)
  60.  END
  61. ELSE
  62.  DO
  63.   Dirname=LEFT(TempFileName,P-1)
  64.   Filename=SUBSTR(TempFileName,P+1)
  65.  END
  66.  
  67. ADDRESS 'FilerRexx'
  68. 'READSOURCEDIR' Dirname
  69. 'SELECTENTRY "'||Filename||'"'
  70.  
  71. /* Let the action begin. */
  72.  
  73. ACTION
  74.